// Copyright DustedPixels.com 2008. All rights reserved.

package kroff;

import com.dustedpixels.common.base.Repeatable;

/**
 * @author micapolos@gmail.com (Michal Pociecha-Los)
 */
public final class HalfOptimizedKroffUnit implements Repeatable {
  private boolean signal1;
  private boolean signal2;
  private boolean signal3;
  
  public void repeat(int steps) {
    if (steps < 0) throw new IllegalArgumentException("Negative steps");

    while (steps-- != 0) {
      signal1 = !signal1;
      signal2 = signal1 && signal3;
      signal3 = !signal2;
    }
  }
}
